package com.hqyj.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

/**
 * 项目:demo-springboot-230701
 * 描述:
 * 时间:2023/9/25 13:31
 * 作者:admin
 * 版本:1.0
 **/
//@Configuration
public class AutoBrowerConfig implements CommandLineRunner {

    //浏览器路径
    @Value("${borwerPath}")
    private String browerPath;
    //默认访问路径
    @Value("${bathUrl}")
    private String path;

    @Override
    public void run(String... args) throws Exception {
        //拼接命令
        String commnd=browerPath+" "+path;
        System.out.println(commnd);
        //运行cmd命令
        Runtime run = Runtime.getRuntime();
        run.exec(commnd);
    }
}
